@extends('layouts.app')
@section('content')
    <section class="content-header">
        <h1 class="pull-left">文章列表</h1>
        <h1 class="pull-right">
            <a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('article.create') !!}"><i class="glyphicon glyphicon-plus"></i>添加</a>
        </h1>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box box-success">
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div id="example1_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="example1" class="table table-bordered table-striped dataTable"
                                           role="grid" aria-describedby="example1_info">
                                        <thead>
                                        <tr role="row">
                                            <th class="sorting_asc" >id</th>
                                            <th class="sorting" >标题</th>
                                            <th class="sorting" >作者</th>
                                            <th class="sorting" >版权</th>
                                            <th class="sorting" >图片</th>
                                            <th class="sorting" >标签</th>
                                            <th class="sorting" >阅读量</th>
                                            <th class="sorting" >点赞量</th>
                                            <th class="sorting" >排序</th>
                                            <th class="sorting" >状态</th>
                                            <th class="sorting" >操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach( $articles as $article )
                                            <tr role="row">
                                                <td class="sorting_1">{{ $article->id }}</td>
                                                <td>{{ $article->title }}</td>
                                                <td>{{ $article->author }}</td>
                                                <td>{{ $article->copyright }}</td>
                                                <td>
                                                    <img src="{{ $article->img?$article->img:'http://nihaocai.oss-cn-hangzhou.aliyuncs.com/article/dK3NhxDxdBDhC854PZBprqfuDmyPSEeJNu6F9nsI.png' }}?x-oss-process=image/resize,m_mfit,h_75,w_33" style="width:75px;height:33px;" alt="">
                                                </td>
                                                <td>{{ $article->label }}</td>
                                                <td>{{ $article->reading_quantity }}</td>
                                                <td>{{ $article->point_number }}</td>
                                                <td>{{ $article->sort }}</td>
                                                <td>{{ $article->status==1?'显示':'隐藏' }}</td>
                                                <td>
                                                    <a href="{{ route('article.edit', ['id'=>$article->id] ) }}" class="fa fa-pencil-square-o i-black" aria-hidden="true" title="修改" ></a>
                                                </td>
                                            </tr>
                                        @endforeach
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="pull-right" >
                                        {{ $articles->links() }}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>

@endsection